import { defineStore } from 'pinia';

const useStore = defineStore('acfOpts', {
	state: () => {
		return {
			visible: false,
			menuItems: [{
				index: 'player',
				title: '播放器'
			}, {
				index: 'feedback',
				title: '反馈'
			}, {
				index: 'sound',
				title: '声音'
			}, {
				index: 'canvas',
				title: '画布'
			}],
			menuActive: 'player'
		}
	},
	actions: {
		openMenu(index) {
			if (this.visible && index === this.menuActive) return;
			if (index) this.menuActive = index;
			this.visible = true;
		}
	}
})

export default useStore;